
<HTML><HEAD><TITLE>Manpage of 3proxy.conf</TITLE>
</HEAD><BODY>
<H1>3proxy.conf</H1>
Section: Universal proxy server (5)<BR>Updated: December 2004<BR><A HREF="#index">Index</A>
<A HREF="../index.html">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

<B>3proxy.conf</B>

- 3proxy configuration file
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>



Common structure:

Configuration file is a text file 3proxy reads configuration from. Each line
of the file is command and is executed immediately, as it was given from
console. Each line of the file is treated as a blank (space or tab) separated
command line. Additional space characters are ignored. 
Think about 3proxy as &quot;application level router&quot; with console interface.

Comments:

Any string beginning with space character or '#' character is comment. It's
ignored. &lt;LF&gt;s are ignored. &lt;CR&gt; is end of command.


Quotation:

Quotation character is spaces or another special characters. To use quotation character inside
quotation character must be dubbed (BASIC convention). For example to use
HELLO Good practice is to quote any argument you use.

File inclusion:

You can include file by using $FILENAME macro (replace FILENAME with a path
to file, for example $/usr/local/etc/3proxy/conf.incl or 
<BR>&nbsp;$&quot;c:\Program&nbsp;Files\3proxy\include.cfg&quot;&nbsp;Quotation&nbsp;is
required in last example because path contains space character. 
For included file &lt;CR&gt; (end of line characters) is treated as space character
(arguments delimiter instead of end of command delimiter). 
Thus, include files are only useful to store long signle-line commands
(like userlist, network lists, etc).
To use dollar sign somewhere in argument it must be quoted. 
Recursion is not allowed.

Commands:

<B>proxy</B>

[options]
<BR>

<B>socks</B>

[options]
<BR>

<B>pop3p</B>

[options]
<BR>

<B>ftppr</B>

[options]
<BR>

<B>admin</B>

[options]
<BR>

<B>dnspr</B>

[options]
<BR>

<B>tcppm</B>

[options]
&lt;SRCPORT&gt; &lt;DSTADDR&gt; &lt;DSTPORT&gt;
<BR>

<B>udppm</B>

[options]
&lt;SRCPORT&gt; &lt;DSTADDR&gt; &lt;DSTPORT&gt;

starts gateway services

<B>proxy</B>

- HTTP/HTTPS proxy (default port 3128)
<BR>

<B>socks</B>

- SOCKS 4/4.5/5 proxy (default port 1080)
<BR>

<B>pop3p</B>

- POP3 proxy (default port 110)
<BR>

<B>ftppr</B>

- FTP proxy (default port 21)
<BR>

<B>admin</B>

- Web interface (default port 80)
<BR>

<B>dnspr</B>

- caching DNS proxy (default port 53)
<BR>

<B>tcppm</B>

- TCP portmapper
<BR>

<B>udppm</B>

- UDP portmapper

Options:
<BR>

<B>-pNUMBER</B>

change default server port to NUMBER
<BR>

<B>-n</B>

disable NTLM authentication (required if passwords are stored in Unix crypt format.
<BR>

Also, all options mentioned for 
<B><A HREF="../man8/proxy.8.html">proxy</A></B>(8)

<B><A HREF="../man8/socks.8.html">socks</A></B>(8)

<B><A HREF="../man8/pop3p.8.html">pop3p</A></B>(8)

<B><A HREF="../man8/tcppm.8.html">tcppm</A></B>(8)

<B><A HREF="../man8/udppm.8.html">udppm</A></B>(8)

<B><A HREF="../man8/ftppr.8.html">ftppr</A></B>(8)

are also supported.

Portmapping services listen at SRCPORT and connect to DSTADDR:DSTPORT
HTTP and SOCKS proxies are standard. 

POP3 proxy must be configured as POP3 server and requires username in the form of:
<A HREF="mailto:pop3username@pop3server">pop3username@pop3server</A>. If POP3 proxy access must be authenticated, you can
specify username as proxy_username:proxy_password:<A HREF="mailto:POP3_username@pop3server">POP3_username@pop3server</A>

DNS proxy is only capable to resolve hostnames (no MX, PTR, SRV, etc) and
requires nserver/nscache to be configured.

FTP proxy can be used as FTP server in any FTP client or configured as FTP
proxy on a client with FTP proxy support. Username format is one of
<BR>&nbsp;<A HREF="mailto:FTPuser@FTPServer">FTPuser@FTPServer</A>
<BR>&nbsp;FTPuser:<A HREF="mailto:FTPpassword@FTPserver">FTPpassword@FTPserver</A>
<BR>&nbsp;proxyuser:proxypassword:FTPuser:<A HREF="mailto:FTPpassword@FTPserver">FTPpassword@FTPserver</A>
<BR>

Please note, if you use FTP client interface for FTP proxy
do not add FTPpassword and FTPServer to username, because
FTP client does it for you. That is, if you use 3proxy with
authentication use
proxyuser:proxypassword:FTPuser
as FTP username, otherwise do not change original FTP user name<TT>&nbsp;</TT><BR>

<B>config</B>

&lt;path&gt;
<BR>

Path to configuration file to use on 3proxy restart or to save configuration.

<B>writable</B>

<BR>

ReOpens configuration file for write access via Web interface,
and re-reads it. Usually should be first command on config file
but in combination with &quot;config&quot; it can be used anywhere to open
alternate config file. Think twice before using it.

<B>end</B>

<BR>

End of configuration

<B>log</B>

[[@|&amp;]logfile] [&lt;LOGTYPE&gt;]
<BR>

sets logfile for all gateways
<BR>&nbsp;@&nbsp;-&nbsp;(for&nbsp;Unix)&nbsp;use&nbsp;syslog,&nbsp;filename&nbsp;is&nbsp;used&nbsp;as&nbsp;ident&nbsp;name
<BR>&nbsp;&amp;&nbsp;-&nbsp;use&nbsp;ODBC,&nbsp;filename&nbsp;consists&nbsp;of&nbsp;comma-delimited&nbsp;datasource,username,password&nbsp;(username&nbsp;and&nbsp;password&nbsp;are&nbsp;optional)
<BR>&nbsp;LOGTYPE&nbsp;is&nbsp;one&nbsp;of:
<BR>&nbsp;&nbsp;M&nbsp;-&nbsp;Monthly
<BR>&nbsp;&nbsp;W&nbsp;-&nbsp;Weekly&nbsp;(starting&nbsp;from&nbsp;Sunday)
<BR>&nbsp;&nbsp;D&nbsp;-&nbsp;Daily
<BR>&nbsp;&nbsp;H&nbsp;-&nbsp;Hourly
if logfile is not specified logging goes to stdout. You can specify individual logging options for gateway by using
-l option in gateway configuration.

<B>rotate</B>

&lt;n&gt;
how many archived log files to keep

<B>logformat</B>

&lt;format&gt;

Format for log record. First symbol in format must be L (local time)
or G (absolute Grinwitch time). 
It can be preceeded with -XXX+Y where XXX is list of characters to be
filtered in user input (any non-printable characters are filtered too
in this case) and Y is replacement character. For example, &quot;-,%+ L&quot; in
the beginning of logformat means comma and percent are replaced
with space and all time based elemnts are in local time zone.
You can use:

<BR>&nbsp;%y&nbsp;-&nbsp;Year&nbsp;in&nbsp;2&nbsp;digit&nbsp;format
<BR>&nbsp;%Y&nbsp;-&nbsp;Year&nbsp;in&nbsp;4&nbsp;digit&nbsp;format
<BR>&nbsp;%m&nbsp;-&nbsp;Month&nbsp;number
<BR>&nbsp;%o&nbsp;-&nbsp;Month&nbsp;abbriviature
<BR>&nbsp;%d&nbsp;-&nbsp;Day
<BR>&nbsp;%H&nbsp;-&nbsp;Hour
<BR>&nbsp;%M&nbsp;-&nbsp;Minute
<BR>&nbsp;%S&nbsp;-&nbsp;Second
<BR>&nbsp;%t&nbsp;-&nbsp;Timstamp&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;01-Jan-1970)
<BR>&nbsp;%.&nbsp;-&nbsp;milliseconds
<BR>&nbsp;%z&nbsp;-&nbsp;timeZone&nbsp;(from&nbsp;Grinvitch)
<BR>&nbsp;%D&nbsp;-&nbsp;request&nbsp;duration&nbsp;(in&nbsp;milliseconds)
<BR>&nbsp;%b&nbsp;-&nbsp;average&nbsp;send&nbsp;rate&nbsp;per&nbsp;request&nbsp;(in&nbsp;Bytes&nbsp;per&nbsp;second)&nbsp;this&nbsp;speed&nbsp;is&nbsp;typically&nbsp;below&nbsp;connection&nbsp;speed&nbsp;shown&nbsp;by&nbsp;download&nbsp;manager.
<BR>&nbsp;%B&nbsp;-&nbsp;average&nbsp;receive&nbsp;rate&nbsp;per&nbsp;request&nbsp;(in&nbsp;Bytes&nbsp;per&nbsp;second)&nbsp;this&nbsp;speed&nbsp;is&nbsp;typically&nbsp;below&nbsp;connection&nbsp;speed&nbsp;shown&nbsp;by&nbsp;download&nbsp;manager.
<BR>&nbsp;%U&nbsp;-&nbsp;Username
<BR>&nbsp;%N&nbsp;-&nbsp;service&nbsp;Name
<BR>&nbsp;%p&nbsp;-&nbsp;service&nbsp;Port
<BR>&nbsp;%E&nbsp;-&nbsp;Error&nbsp;code
<BR>&nbsp;%C&nbsp;-&nbsp;Client&nbsp;IP
<BR>&nbsp;%c&nbsp;-&nbsp;Client&nbsp;port
<BR>&nbsp;%R&nbsp;-&nbsp;Remote&nbsp;IP
<BR>&nbsp;%r&nbsp;-&nbsp;Remote&nbsp;port
<BR>&nbsp;%n&nbsp;-&nbsp;requested&nbsp;hostname
<BR>&nbsp;%I&nbsp;-&nbsp;bytes&nbsp;In
<BR>&nbsp;%O&nbsp;-&nbsp;bytes&nbsp;Out
<BR>&nbsp;%h&nbsp;-&nbsp;Hops&nbsp;(redirections)&nbsp;count
<BR>&nbsp;%T&nbsp;-&nbsp;service&nbsp;specific&nbsp;Text
<BR>&nbsp;%N1-N2T&nbsp;-&nbsp;(N1&nbsp;and&nbsp;N2&nbsp;are&nbsp;positive&nbsp;numbers)&nbsp;-&nbsp;log&nbsp;only&nbsp;fields&nbsp;from&nbsp;N1&nbsp;thorugh&nbsp;N2&nbsp;of&nbsp;service&nbsp;specific&nbsp;text
in case of ODBC logging logformat specifies SQL statement, for exmample:
<BR>&nbsp;&nbsp;&nbsp;logformat&nbsp;&quot;-'+_Linsert&nbsp;into&nbsp;log&nbsp;(l_date,&nbsp;l_user,&nbsp;l_service,&nbsp;l_in,&nbsp;l_out,&nbsp;l_descr)&nbsp;values&nbsp;('%d-%m-%Y&nbsp;%H:%M:%S',&nbsp;'%U',&nbsp;'%N',&nbsp;%I,&nbsp;%O,&nbsp;'%T')&quot;

<B>archiver</B>

&lt;ext&gt; &lt;commandline&gt;
<BR>

Archiver to use for log files. &lt;ext&gt; is file extension produced by
archiver. Filename will be last argument to archiver, optionally you
can use %A as produced archive name and %F as filename.

<B>timeouts</B>

&lt;BYTE_SHORT&gt; &lt;BYTE_LONG&gt; &lt;STRING_SHORT&gt; &lt;STRING_LONG&gt; &lt;CONNECTION_SHORT&gt; &lt;CONNECTION_LONG&gt; &lt;DNS&gt; &lt;CHAIN&gt;
Sets timeout values
<BR>&nbsp;BYTE_SHORT&nbsp;-&nbsp;short&nbsp;timeout&nbsp;for&nbsp;single&nbsp;byte,&nbsp;is&nbsp;usually&nbsp;used&nbsp;for&nbsp;receiving&nbsp;single&nbsp;byte&nbsp;from&nbsp;stream.
<BR>&nbsp;BYTE_LONG&nbsp;-&nbsp;long&nbsp;timeout&nbsp;for&nbsp;single&nbsp;byte,&nbsp;is&nbsp;usually&nbsp;used&nbsp;for&nbsp;receiving&nbsp;first&nbsp;byte&nbsp;in&nbsp;frame&nbsp;(for&nbsp;example&nbsp;first&nbsp;byte&nbsp;in&nbsp;socks&nbsp;request).
<BR>&nbsp;STRING_SHORT&nbsp;-&nbsp;short&nbsp;timeout,&nbsp;for&nbsp;character&nbsp;string&nbsp;within&nbsp;stream&nbsp;(for&nbsp;example&nbsp;to&nbsp;wait&nbsp;between&nbsp;2&nbsp;HTTP&nbsp;headers)
<BR>&nbsp;STRING_LONG&nbsp;-&nbsp;long&nbsp;timeout,&nbsp;for&nbsp;first&nbsp;string&nbsp;in&nbsp;stream&nbsp;(for&nbsp;example&nbsp;to&nbsp;wait&nbsp;for&nbsp;HTTP&nbsp;request).
<BR>&nbsp;CONNECTION_SHORT&nbsp;-&nbsp;inactivity&nbsp;timeout&nbsp;for&nbsp;short&nbsp;connections&nbsp;(HTTP,&nbsp;POP3,&nbsp;etc).
<BR>&nbsp;CONNECTION_LONG&nbsp;-&nbsp;inactivity&nbsp;timeout&nbsp;for&nbsp;long&nbsp;connection&nbsp;(SOCKS,&nbsp;portmappers,&nbsp;etc).
<BR>&nbsp;DNS&nbsp;-&nbsp;timeout&nbsp;for&nbsp;DNS&nbsp;request&nbsp;before&nbsp;requesting&nbsp;next&nbsp;server
<BR>&nbsp;CHAIN&nbsp;-&nbsp;timeout&nbsp;for&nbsp;reading&nbsp;data&nbsp;from&nbsp;chained&nbsp;connection

<B>nserver</B>

<BR>&nbsp;&lt;ipaddr&gt;
<BR>

Nameserver to use for name resolutions. If none spcified system
or name server fails system routines for name resolution will be
used. It's better to specify nserver because gethostbyname() may
be thread unsafe.

<B>nscache</B>

&lt;cachesize&gt;
<BR>


Cache &lt;cachesize&gt; records for name resolution. Cachesize usually
should be large enougth (for example 65536).

<B>nsrecord</B>

&lt;hostname&gt; &lt;hostaddr&gt;
<B></B>

Adds static record to nscache. nscache must be enabled. If 0.0.0.0
is used as a hostaddr host will never resolve, it can be used to
blacklist something or together with 
<B>dialer</B>

command to set up UDL for dialing.

<B>dialer</B>

&lt;progname&gt;
<BR>

Execute progname if external name can't be resolved.
Hint: if you use nscache, dialer may not work, because names will
be resolved through cache. In this case you can use something like
<A HREF="http://dial.right.now/">http://dial.right.now/</A> from browser to set up connection.


<B>internal</B>

&lt;ipaddr&gt;
<BR>

sets ip address of internal interface. This IP address will be used
to bind gateways. Alternatively you can use -i option for individual
gateways

<B>external</B>

&lt;ipaddr&gt;
<BR>

sets ip address of external interface. This IP address will be source
address for all connections made by proxy. Alternatively you can use
-e option to specify individual address for gateway.
<BR>&nbsp;&nbsp;&nbsp;
<B>maxconn</B>

&lt;number&gt;
<BR>

sets maximum number of simulationeous connections to each services
started after this command. Default is 100.

<B>service</B>

<BR>

(depricated) Should be specified to launch as Windows 95/98/NT/2000/XP service,
no effect for Unix. Is not reqired since 0.6, but you must re-install 3proxy
service with --remove and --install.

<B>daemon</B>

<BR>

Should be specified to close console (not required for 'service').
At least under FreeBSD 'daemon' should preceed any proxy service
and log commands to avoid sockets problem. Always place it in the beginning
of the configuration file.

<B>auth</B>

<BR>

Type of user authorization. Currently supported:
<BR>&nbsp;none&nbsp;-&nbsp;no&nbsp;authorization&nbsp;required.&nbsp;Note:&nbsp;is&nbsp;auth&nbsp;is&nbsp;none&nbsp;any&nbsp;ip&nbsp;based&nbsp;limitation,&nbsp;redirection,&nbsp;etc&nbsp;will&nbsp;not&nbsp;work.&nbsp;
<BR>&nbsp;iponly&nbsp;-&nbsp;authorization&nbsp;by&nbsp;source/destination&nbsp;IP&nbsp;and&nbsp;ports.&nbsp;Appropriate&nbsp;for&nbsp;most&nbsp;cases
<BR>&nbsp;nbname&nbsp;-&nbsp;iponly&nbsp;+&nbsp;authorization&nbsp;by&nbsp;NetBIOS&nbsp;name.&nbsp;Messanger
service should be started on user's machine. Note, that
Windows 95/98 hosts do not have messanger service by default,
WinPopup program need to be started.
NB: there is no any password check, name may be spoofed.
Think about it as about ident for Windows.
<BR>&nbsp;Q:&nbsp;Will&nbsp;ident&nbsp;authorization&nbsp;be&nbsp;implemented?
<BR>&nbsp;A:&nbsp;Yes,&nbsp;as&nbsp;soon&nbsp;as&nbsp;it&nbsp;will&nbsp;be&nbsp;required&nbsp;by&nbsp;someone.
<BR>&nbsp;strong&nbsp;-&nbsp;username/password&nbsp;authentication&nbsp;required.&nbsp;It&nbsp;will&nbsp;work&nbsp;with&nbsp;SOCKSv5,&nbsp;FTP,&nbsp;POP3&nbsp;and&nbsp;HTTP&nbsp;proxy.

<B>allow</B>

&lt;userlist&gt; &lt;sourcelist&gt; &lt;targetlist&gt; &lt;targetportlist&gt; &lt;operationlist&gt;
&lt;weekdayslist&gt; &lt;timeperiodslist&gt;
<BR>

<B>deny</B>

&lt;userlist&gt; &lt;sourcelist&gt; &lt;targetlist&gt; &lt;targetportlist&gt; &lt;operationlist&gt;
&lt;weekdayslist&gt; &lt;timeperiodslist&gt;
<BR>

Access control entries. All lists are comma-separated, no spaces are
allowed. Usernames are case sensitive (if used with authtype nbname
username must be in uppercase). Source and target lists may contain
IP addresses (W.X.Y.Z) or CIDRs (W.X.Y.Z/L). Targetportlist may
contain ports (X) or port lists (X-Y).<TT>&nbsp;&nbsp;</TT>For any field * sign means &quot;ANY&quot;<BR>
If access list is empty it's assumed to be
<BR>&nbsp;allow&nbsp;*
If access list is not empty last item in access list is assumed to be
<BR>&nbsp;deny&nbsp;*
You may want explicitly add &quot;deny *&quot; into the end of access list to prevent
HTTP proxy from requesting user's password.
Access lists are checked after user have requested any resource.
If you want 3proxy to reject connections from specific addresses
immediately without any conditions you should either bind proxy
to appropriate interface only or to use ip filters.

Operation is one of:
<BR>&nbsp;CONNECT<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>-&nbsp;establish&nbsp;outgoing&nbsp;TCP&nbsp;connection<BR>
<BR>&nbsp;BIND&nbsp;-&nbsp;bind&nbsp;TCP&nbsp;port&nbsp;for&nbsp;listening
<BR>&nbsp;UDPASSOC&nbsp;-&nbsp;make&nbsp;UDP&nbsp;association
<BR>&nbsp;ICMPASSOC&nbsp;-&nbsp;make&nbsp;ICMP&nbsp;association&nbsp;(for&nbsp;future&nbsp;use)
<BR>&nbsp;HTTP_GET&nbsp;-&nbsp;HTTP&nbsp;GET&nbsp;request
<BR>&nbsp;HTTP_PUT&nbsp;-&nbsp;HTTP&nbsp;PUT&nbsp;request
<BR>&nbsp;HTTP_POST&nbsp;-&nbsp;HTTP&nbsp;POST&nbsp;request
<BR>&nbsp;HTTP_HEAD&nbsp;-&nbsp;HTTP&nbsp;HEAD&nbsp;request
<BR>&nbsp;HTTP_CONNECT&nbsp;-&nbsp;HTTP&nbsp;CONNECT&nbsp;request
<BR>&nbsp;HTTP_OTHER&nbsp;-&nbsp;over&nbsp;HTTP&nbsp;request
<BR>&nbsp;HTTP&nbsp;-&nbsp;matches&nbsp;any&nbsp;HTTP&nbsp;request&nbsp;except&nbsp;HTTP_CONNECT
<BR>&nbsp;HTTPS&nbsp;-&nbsp;same&nbsp;as&nbsp;HTTP_CONNECT
<BR>&nbsp;FTP_GET&nbsp;-&nbsp;FTP&nbsp;get&nbsp;request
<BR>&nbsp;FTP_PUT&nbsp;-&nbsp;FTP&nbsp;put&nbsp;request
<BR>&nbsp;FTP_LIST&nbsp;-&nbsp;FTP&nbsp;list&nbsp;request
<BR>&nbsp;FTP&nbsp;-&nbsp;matches&nbsp;any&nbsp;FTP&nbsp;request

Weeksdays are week days numbers or periods (0 or 7 means Sunday, 1 is Monday,
1-5 means Monday through Friday). Timeperiodlists is a list of time
periods in HH:MM:SS-HH:MM:SS format. For example, 
<BR>&nbsp;00:00:00-08:00:00,17:00:00-24:00:00
lists non-working hours.
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT><BR>
<B>parent</B>

&lt;weight&gt; &lt;type&gt; &lt;ip&gt; &lt;port&gt; &lt;username&gt; &lt;password&gt;
<BR>

this command may follow &quot;allow&quot; rule. It extends last allow rule to
build proxy chain. Proxy may be grouped. Proxy inside the
group is selected randomely. If few groups are specified one proxy
is randomely picked from each group and chain of proxies is created
(that is second proxy connected through first one and so on).
Weight is used to group proxies. Weigt is a number between 1 and 1000.
Weights are summed and proxies are grouped together untill weight of
group is 1000. That is:
<BR>&nbsp;allow&nbsp;*
<BR>&nbsp;parent&nbsp;500&nbsp;socks5&nbsp;192.168.10.1&nbsp;1080
<BR>&nbsp;parent&nbsp;500&nbsp;connect&nbsp;192.168.10.1&nbsp;3128
makes 3proxy to randomely choose between 2 proxies for all outgoing
connections
<BR>&nbsp;allow&nbsp;*&nbsp;*&nbsp;*&nbsp;80
<BR>&nbsp;parent&nbsp;1000&nbsp;socks5&nbsp;192.168.10.1&nbsp;1080
<BR>&nbsp;parent&nbsp;1000&nbsp;connect&nbsp;192.168.20.1&nbsp;3128
<BR>&nbsp;parent&nbsp;300&nbsp;socks4&nbsp;192.168.30.1&nbsp;1080
<BR>&nbsp;parent&nbsp;700&nbsp;socks5&nbsp;192.168.40.1&nbsp;1080
creates chain of 3 proxies: 192.168.10.1, 192.168.20.1 and third
is (192.168.30.1 with probability of 0.3 or 192.168.40.1
with probability of 0.7) for outgoing web connections.

type is one of:
<BR>&nbsp;tcp&nbsp;-&nbsp;simply&nbsp;redirect&nbsp;connection.&nbsp;TCP&nbsp;is&nbsp;always&nbsp;last&nbsp;in&nbsp;chain.
<BR>&nbsp;http&nbsp;-&nbsp;redirect&nbsp;to&nbsp;HTTP&nbsp;proxy.&nbsp;HTTP&nbsp;is&nbsp;always&nbsp;last&nbsp;chain.
<BR>&nbsp;pop3&nbsp;-&nbsp;redirect&nbsp;to&nbsp;POP3&nbsp;proxy&nbsp;(only&nbsp;local&nbsp;redirection&nbsp;is&nbsp;supported,&nbsp;can&nbsp;not&nbsp;be
used for chaining)
<BR>&nbsp;ftp&nbsp;-&nbsp;redirect&nbsp;to&nbsp;FTP&nbsp;proxy&nbsp;(only&nbsp;local&nbsp;redirection&nbsp;is&nbsp;supported,&nbsp;can&nbsp;not&nbsp;be
used for chaining)
<BR>&nbsp;connect&nbsp;-&nbsp;parent&nbsp;is&nbsp;HTTP&nbsp;CONNECT&nbsp;method&nbsp;proxy
<BR>&nbsp;socks4&nbsp;-&nbsp;parent&nbsp;is&nbsp;SOCKSv4&nbsp;proxy
<BR>&nbsp;socks5&nbsp;-&nbsp;parent&nbsp;is&nbsp;SOCKSv5&nbsp;proxy

IP and port are ip addres and port of parent proxy server.
If IP is zero, ip is taken from original request, only port is changed.
If port is zero, it's taken from original request, only IP is changed.
If both IP and port are zero - it's a special case of local redirection,
it works only with

socks
proxy. In case of local redirection request is redirected to different service,

<B>ftppr</B>


<B>pop3p</B>


<B>proxy .</B>


Main purpose of local redirections is to have requested resource
(URL or POP3 username) logged and protocol-specific filters to be applied.
In case of local redirection ACLs are revied twice: first, by SOCKS proxy up to

redirected (HTTP, FTP or POP3) after 'parent' command. It means,
additional 'allow' command is required for redirected requests, for
example:
<BR>&nbsp;allow&nbsp;*&nbsp;*&nbsp;*&nbsp;80
<BR>&nbsp;parent&nbsp;1000&nbsp;http&nbsp;0.0.0.0&nbsp;0
<BR>&nbsp;allow&nbsp;*&nbsp;*&nbsp;*&nbsp;80&nbsp;HTTP_GET,HTTP_POST
<BR>&nbsp;socks
redirects all SOCKS requests with target port 80 to local HTTP proxy,
local HTTP proxy parses requests and allows only GET and POST requests.

Optional username and password are used to authenticate on parent
proxy. Username of '*' means username must be supplied by user.

<B>bandlimin</B>

&lt;rate&gt; &lt;userlist&gt; &lt;sourcelist&gt; &lt;targetlist&gt; &lt;targetportlist&gt; &lt;operationlist&gt;
<BR>

<B>nobandlimin</B>

&lt;userlist&gt; &lt;sourcelist&gt; &lt;targetlist&gt; &lt;targetportlist&gt; &lt;operationlist&gt;
<BR>

bandlim sets bandwith limitation filter to &lt;rate&gt; bps (bits per second)
(if you want to specife bytes per second - multiply your value to 8).
bandlim rules act in a same manner as allow/deny rules except
one thing: bandwidth limiting is applied to all services, not to some
specific service. 
bandlimin and nobandlimin applies to incoming traffic
bandlimout and nobandlimout applies to outgoing traffic
If tou want to ratelimit your clients with ip's 192.168.10.16/30 (4
addresses) to 57600 bps you have to specify 4 rules like
<BR>&nbsp;bandlimin&nbsp;57600&nbsp;*&nbsp;192.168.10.16
<BR>&nbsp;bandlimin&nbsp;57600&nbsp;*&nbsp;192.168.10.17
<BR>&nbsp;bandlimin&nbsp;57600&nbsp;*&nbsp;192.168.10.18
<BR>&nbsp;bandlimin&nbsp;57600&nbsp;*&nbsp;192.168.10.19
and every of you clients will have 56K channel.<TT>&nbsp;</TT>if you specify<BR>
<BR>&nbsp;bandlimin&nbsp;57600&nbsp;*&nbsp;192.168.10.16/30
you will have 56K channel shared between all clients.
if you want, for example, to limit all speed ecept access to POP3 you can use
<BR>&nbsp;nobandlimin&nbsp;*&nbsp;*&nbsp;*&nbsp;110
before the rest of bandlim rules.

<B>counter</B>

&lt;filename&gt; &lt;reporttype&gt; &lt;repotname&gt;
<BR>

<B>countin</B>

&lt;number&gt; &lt;type&gt; &lt;limit&gt; &lt;userlist&gt; &lt;sourcelist&gt; &lt;targetlist&gt; &lt;targetportlist&gt; &lt;operationlist&gt;
<BR>

<B>nocountin</B>

&lt;userlist&gt; &lt;sourcelist&gt; &lt;targetlist&gt; &lt;targetportlist&gt; &lt;operationlist&gt;
<BR>


counter, countin, nocountin commands are used to set traffic limit
in MB for period of time (day, week or month). Filename is a path
to a special file where traffic information is permanently stored.
number is sequential number of record in this file. If number is 0
no traffic information  on this counter is saved in file (that is
if proxy restarted all information is loosed) overwise it should be
unique sequential number.
Type specifies a type of counter. Type is one of:
<BR>&nbsp;D&nbsp;-&nbsp;counter&nbsp;is&nbsp;resetted&nbsp;daily
<BR>&nbsp;W&nbsp;-&nbsp;counter&nbsp;is&nbsp;resetted&nbsp;weekly
<BR>&nbsp;M&nbsp;-&nbsp;counter&nbsp;is&nbsp;resetted&nbsp;monthely
reporttype/repotname may be used to generate traffic reports.
Reporttype is one of D,W,M,H(hourly) and repotname specifies filename
template for reports. Report is text file with counter values in
format:
<BR>&nbsp;&lt;COUNTERNUMBER&gt;&nbsp;&lt;TRAF*4GB&gt;&nbsp;&lt;TRAF&gt;
The rest of parameters is identical to bandlim/nobandlim.

<B>users</B>

username[:pwtype:password] ...
<BR>

pwtype is one of:
<BR>&nbsp;none&nbsp;(empty)&nbsp;-&nbsp;use&nbsp;system&nbsp;authentication
<BR>&nbsp;CL&nbsp;-&nbsp;password&nbsp;is&nbsp;cleartext
<BR>&nbsp;CR&nbsp;-&nbsp;password&nbsp;is&nbsp;crypt-style&nbsp;password
<BR>&nbsp;NT&nbsp;-&nbsp;password&nbsp;is&nbsp;NT&nbsp;password&nbsp;(in&nbsp;hex)
example:
<BR>&nbsp;users&nbsp;test1:CL:password1&nbsp;&quot;test2:CR:$1$lFDGlder$pLRb4cU2D7GAT58YQvY49.&quot;
<BR>&nbsp;users&nbsp;test3:NT:BD7DFBF29A93F93C63CB84790DA00E63
<BR>

(note: double quotes are requiered because password contains $ sign).<TT>&nbsp;&nbsp;</TT><BR>

<B>flush</B>

<BR>

empty active access list. Access list must be flushed avery time you creating
new access list for new service. For example:
<BR>&nbsp;allow&nbsp;*
<BR>&nbsp;pop3p
<BR>&nbsp;flush
<BR>&nbsp;allow&nbsp;*&nbsp;192.168.1.0/24
<BR>&nbsp;socks
sets different ACLs for
<B>pop3p</B>

and
<B>socks</B>


<B>system</B>

<BR>

execute system command

<B>pidfile</B>

&lt;filename&gt;
<BR>

write pid of current process to file. It can be used to manipulate
3proxy with signals under Unix. Currently next signals are available:

<B>setuid</B>

&lt;uid&gt;
<BR>

calls setuid(uid), uid must be numeric. Unix only.

<B>setgid</B>

&lt;gid&gt;
<BR>

calls setgid(gid), gid must be numeric. Unix only.

<B>chroot</B>

&lt;path&gt;
<BR>

calls chroot(path). Unix only.
<A NAME="lbAD">&nbsp;</A>
<H2>SEE ALSO</H2>

<A HREF="../man8/3proxy.8.html">3proxy</A>(8), <A HREF="../man8/proxy.8.html">proxy</A>(8), <A HREF="../man8/ftppr.8.html">ftppr</A>(8), <A HREF="../man8/socks.8.html">socks</A>(8), <A HREF="../man8/pop3p.8.html">pop3p</A>(8), <A HREF="../man8/tcppm.8.html">tcppm</A>(8), <A HREF="../man8/udppm.8.html">udppm</A>(8), <A HREF="../man8/syslogd.8.html">syslogd</A>(8),
<BR>

<A HREF="http://3proxy.ru/">http://3proxy.ru/</A>
<A NAME="lbAE">&nbsp;</A>
<H2>TRIVIA</H2>

3APA3A is pronounced as ``zaraza''.
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHORS</H2>

3proxy is designed by 3APA3A
(<I><A HREF="mailto:3APA3A@security.nnov.ru">3APA3A@security.nnov.ru</A></I>),

Vladimir Dubrovin
(<I><A HREF="mailto:vlad@sandy.ru">vlad@sandy.ru</A></I>)

<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT><A HREF="#lbAD">SEE ALSO</A><DD>
<DT><A HREF="#lbAE">TRIVIA</A><DD>
<DT><A HREF="#lbAF">AUTHORS</A><DD>
</DL>
<HR>
This document was created by
using the manual pages.<BR>
Time:  GMT, December 11, 2004
</BODY>
</HTML>
